@inject('appRepository', 'App\Repositories\AppRepository')
@php
    $banner =  $appRepository->getPictureByColumn(1,['文章详情','banner']);
 $right = $appRepository->getPictureByColumn(5,['文章详情','右侧广告位']);
@endphp
@extends('layouts.app')
@section('title','文章')
@section('content')
    <div class="container-fluid page-traval-detail">
        <div class="row banner"
              style="border-top: 1px solid #e7e7e7"
        >
            <div class="container pb-0 body-traval-detail d-flex align-items-end" style="height: 90px">
                <p class="col-10 offset-2 title mb-0" >{{$content->content_detail->title}}</p>
            </div>
        </div>
        {{--    主体内容    --}}
        <div class="container py-0 body-traval-detail" style="position: relative">
            <div class="head-wrap row mb-3">
                @if($content->content_detail->asset)
                <div class="avatar col-2" style="position: absolute;top: -68px;border-radius:50%;">

                    <img src="{{$content->content_detail->asset->path}}" class=" img-circle" style="width: 130px;height: 130px; position: absolute;border-radius:100%;">
                </div>
                @endif
                <div class="info-content col-4 offset-2">
                    <div class="tag-wrap">
                        <div class="tag-list ml-0">
                            {{--                            @foreach($tags as $item)--}}
                            {{--                                <div class="tag-item mr-2">{{$item->name}}</div>--}}
                            {{--                            @endforeach--}}
                        </div>
                        <div class="info-detail d-flex align-items-center">
                            <img class="mr-1" src="{{asset('images\product\place_icon.png')}}" alt=""
                                 style="width: 16px;height: 16px">
                            <span>已读 {{$content->view_count}}</span>
                        </div>
                    </div>
                </div>
                <div class="publish-time d-flex align-items-end col-3 offset-2">发布时间：{{$content->created_at}}</div>
            </div>
            <div class="row content-traval-detail pt-4">
                <div class="col">
                   <div class="hotbox content-info   rounded" >
                        {!! $content->content_detail->content !!}
                    </div>
                </div>
                {{--       右侧广告位       --}}
                @if(count($right))
                <div class="col-lg-2 d-none d-lg-block mb-5">
                    <div class="hotbox rounded my-4  h-100   " >
                        @foreach($right as $item)
                            @if($content->content_detail->asset)
                            <a href="{{$item->content_detail->point_url?url($item->content_detail->point_url):'#'}}">
                                <div class=" hotbox-left-bg h-100 w-100 rounded"
                                     style="margin-bottom: 20px;
                                         background-image: url({{$item->content_detail->asset->path}})">
                                </div>
                            </a>
                            @endif
                        @endforeach
                    </div>
                </div>
                @endif
                <div class="hot-box">
                    {{--     主要body           --}}
                    <div class="hot-body row">

                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
